#ifndef _NETWORK_H_
#define _NETWORK_H_

#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>


void error_if(int condition, char * message);

int is_ip_valid(char * url);

void url_to_adress(char * url, short port, struct sockaddr_in * adress);

int socket_open(char * url, short port);

#endif


